//
//  CaiPuXinShouViewController.m
//  KCZ_B段项目
//
//  Created by dllo on 15/11/5.
//  Copyright © 2015年 Sky. All rights reserved.
//

#import "CaiPuXinShouViewController.h"
#import "FitHeader.h"
#import <MBProgressHUD.h>
@interface CaiPuXinShouViewController ()<UIWebViewDelegate>
@property(nonatomic, strong)UIWebView *webView;
@property(nonatomic, retain)MBProgressHUD *progressView;
@end

@implementation CaiPuXinShouViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"新手入门";
    self.view.backgroundColor = [UIColor whiteColor];
    self.webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, SCREENWIDTH, SCREENHEIGHT + 170)];
    _webView.scalesPageToFit = YES;
    _webView.scrollView.bounces = NO;
    _webView.delegate = self;
    [self.view addSubview:_webView];
    NSURL *url = [NSURL URLWithString:@"http://pub.szzhangchu.com/html/Tour.html"];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [_webView loadRequest:request];
    [self createProgressView];
}

-(void)createProgressView
{
    self.progressView = [[MBProgressHUD alloc]initWithView:self.view];
    [self.view addSubview:_progressView];
    _progressView.labelText = @"加载中...";
    _progressView.backgroundColor = [UIColor whiteColor];
    [_progressView setMode:MBProgressHUDModeIndeterminate];
    [_progressView show:YES];
}
-(void)webViewDidStartLoad:(UIWebView *)webView
{
    
}
-(void)webViewDidFinishLoad:(UIWebView *)webView
{
    [_progressView removeFromSuperview];
}
//-(void)viewWillAppear:(BOOL)animated
//{
//    self.navigationController.navigationBar.alpha = 1;
//    self.navigationController.navigationBar.translucent = NO;
//}
//-(void)viewWillDisappear:(BOOL)animated
//{
//    self.navigationController.navigationBar.translucent = YES;
//}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
